When the Wayland compositor vanishes, all applications connected will
receive a SIGPIPE as soon as they try to use wl_display_dispatch().
Do not use g_error() to terminate the applications when this occurs,
g_error() means an error in the application while here it's not truly
the case.
Use g_warning() and exit() instead.
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
https://bugzilla.gnome.org/show_bug.cgi?id=745289
#include "gdkinternals.h"
#include "gdkprivate-wayland.h"
+#include <stdlib.h>
#include <errno.h>
typedef struct _GdkWaylandEventSource {
if (source->pfd.revents & G_IO_IN)
{
if (wl_display_dispatch (display_wayland->wl_display) < 0)
- g_error ("Error dispatching display: %s", g_strerror (errno));
+ {
+ g_warning ("Error %d (%s) dispatching to Wayland display.",
+ errno, g_strerror (errno));
+ exit (1);
+ }
}
if (source->pfd.revents & (G_IO_ERR | G_IO_HUP))
- g_error ("Lost connection to wayland compositor");
-
+ {
+ g_warning ("Lost connection to Wayland compositor.");
+ exit (1);
+ }
source->pfd.revents = 0;
}